﻿CREATE VIEW [dbo].[vwHoursByProjectAndConsultant]
AS
SELECT     TOP 100 PERCENT dbo.Projects.Name AS ProjectName, dbo.Projects.Description AS ProjectDescription, dbo.EntryLog.EntryDate, 
                      dbo.EntryLog.Duration AS EntryDuration, dbo.EntryLog.Description AS EntryDescription, dbo.Categories.Name AS CategoryName, 
                      dbo.Users.FullName AS UserName, dbo.EntryLog.HasBeenBilled
FROM         dbo.Projects INNER JOIN
                      dbo.EntryLog ON dbo.Projects.ProjectID = dbo.EntryLog.ProjectID INNER JOIN
                      dbo.Users ON dbo.EntryLog.UserID = dbo.Users.UserID INNER JOIN
                      dbo.Categories ON dbo.EntryLog.CategoryID = dbo.Categories.CategoryID
WHERE     (dbo.EntryLog.HasBeenBilled = 0)
ORDER BY dbo.EntryLog.EntryDate;

